/******************************************************************************
	File Name:
		UserAClient.cc
	Description:
		This client uses User A Message System to communicate with its server.
	History:
		PROGRAMMER		Date			Description			
		Hongqi,Wang		06/02/2009		Original

	Note:
	
******************************************************************************/

#include <UserAMessage.h>

void SendMessage ( Message & msg )
	{
	UInt32 msgSize = msg.EncodeSize();
	IpmBuffer ipm;
	ipm.Allocate ( msgSize );
	
	msg.Encode ( ipm.Data(), msgSize );
	ipm.UserType ( msg.msgType );
	
	send (ipm, MySever's dst);
}

void updateMyServer ( )
	{
	UserAMessage msg;
	
	//Assign msg's header
	msg.msgType = UAMT_QUERY;
	msg.transTime = someTime;
	
	//Assign msg's body randomly
	msg.SetField1 ( 0x1234 );
	msg.SetField3 ( 0x1262 );
	msg.SetField4 ( 0x1299 );
	
	//Send this message to server
	SendMessage ( msg );
	}